<html>
<head><meta charset="utf-8"><title>Error in non concrete case only? · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html">Error in non concrete case only?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="216446090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216446090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216446090">(Nov 12 2020 at 09:39)</a>:</h4>
<p>I'm writing a blog post, and need someone to check my understanding.</p>
<p>Rustc doesn't seam to be able to reason about lifetime or trait constraints through a unknown type parameter's associated type.<br>
As we can see in <code>foo_str</code>, rustc knows <code>Of&lt;'a, &amp;str&gt; == Of&lt;'b, &amp;str&gt;</code> and <code>Of&lt;'_, &amp;str&gt; == &amp;str</code>.<br>
It can even prove <code>Of&lt;'a, Gc&lt;&amp;str&gt;&gt; == Of&lt;'b, Gc&lt;&amp;str&gt;&gt;</code> and <code>Of&lt;'_, Gc&lt;&amp;str&gt;&gt; == Gc&lt;&amp;str&gt;</code>.<br>
It just can't see through a type parameter <code>T</code> preventing <code>Of&lt;'a, T&gt; == Of&lt;'b, T&gt;</code>.<br>
A version of this issue occurred in every encoding I attempted.</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="sd">/// Applies a lifetime.</span>
<span class="k">trait</span><span class="w"> </span><span class="n">PlugLife</span><span class="o">&lt;'</span><span class="na">l</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">T</span>: <span class="o">'</span><span class="na">l</span> <span class="o">+</span><span class="w"> </span><span class="n">UnPlugLife</span><span class="o">&lt;</span><span class="n">T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="bp">Self</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="sd">/// Removes a lifetime.</span>
<span class="k">trait</span><span class="w"> </span><span class="n">UnPlugLife</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="sd">/// We can always apply a lifetime after removing one.</span>
<span class="w">    </span><span class="k">type</span> <span class="nc">T</span>: <span class="nc">for</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="w"> </span><span class="n">PlugLife</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="sd">/// Gc with a unapplied lifetime.</span>
<span class="k">struct</span> <span class="nc">GcL</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">(</span><span class="n">PhantomData</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="p">);</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;'</span><span class="na">l</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="nc">PlugLife</span><span class="o">&lt;'</span><span class="na">l</span><span class="o">&gt;&gt;</span><span class="w"> </span><span class="n">PlugLife</span><span class="o">&lt;'</span><span class="na">l</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">GcL</span><span class="o">&lt;</span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">Gc</span><span class="o">&lt;'</span><span class="na">l</span><span class="p">,</span><span class="w"> </span><span class="o">&lt;</span><span class="n">T</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">PlugLife</span><span class="o">&lt;'</span><span class="na">l</span><span class="o">&gt;&gt;</span>::<span class="n">T</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">impl</span><span class="o">&lt;'</span><span class="na">r</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="nc">UnPlugLife</span><span class="o">&gt;</span><span class="w"> </span><span class="n">UnPlugLife</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="n">Gc</span><span class="o">&lt;'</span><span class="na">r</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">GcL</span><span class="o">&lt;&lt;</span><span class="n">T</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">UnPlugLife</span><span class="o">&gt;</span>::<span class="n">T</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="sd">/// Replace a lifetime with `'r`.</span>
<span class="k">type</span> <span class="nc">Of</span><span class="o">&lt;'</span><span class="na">r</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&lt;&lt;</span><span class="n">T</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">UnPlugLife</span><span class="o">&gt;</span>::<span class="n">T</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">PlugLife</span><span class="o">&lt;'</span><span class="na">r</span><span class="o">&gt;&gt;</span>::<span class="n">T</span><span class="p">;</span><span class="w"></span>
</code></pre></div>
<p>The problem can be seen clearest by comparing a concrete function signature to a paramedic one.</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">unsafe</span><span class="w"> </span><span class="k">impl</span><span class="o">&lt;</span><span class="cp">#[may_dangle]</span><span class="w"> </span><span class="o">'</span><span class="na">l</span><span class="o">&gt;</span><span class="w"> </span><span class="n">PlugLife</span><span class="o">&lt;'</span><span class="na">l</span><span class="o">&gt;</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;'</span><span class="nb">static</span><span class="w"> </span><span class="kt">str</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;'</span><span class="na">l</span><span class="w"> </span><span class="kt">str</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>
<span class="k">unsafe</span><span class="w"> </span><span class="k">impl</span><span class="o">&lt;</span><span class="cp">#[may_dangle]</span><span class="w"> </span><span class="o">'</span><span class="na">r</span><span class="o">&gt;</span><span class="w"> </span><span class="n">UnPlugLife</span><span class="w"> </span><span class="k">for</span><span class="w"> </span><span class="o">&amp;'</span><span class="na">r</span><span class="w"> </span><span class="kt">str</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">T</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&amp;'</span><span class="nb">static</span><span class="w"> </span><span class="kt">str</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="sd">/// This compiles!</span>
<span class="k">fn</span> <span class="nf">foo_str</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="o">&gt;</span><span class="p">(</span><span class="n">a</span>: <span class="nc">Of</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="kt">str</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">b</span>: <span class="nc">Of</span><span class="o">&lt;'</span><span class="na">b</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="kt">str</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">a</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">b</span><span class="p">;</span><span class="w"></span>

<span class="w">    </span><span class="n">a</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">b</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="sd">/// But this errors.</span>
<span class="k">fn</span> <span class="nf">foo</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="o">'</span><span class="na">b</span><span class="p">,</span><span class="w"> </span><span class="n">T</span>: <span class="nc">UnPlugLife</span><span class="w"> </span><span class="o">+</span><span class="w"> </span><span class="nb">Eq</span><span class="o">&gt;</span><span class="p">(</span><span class="n">a</span>: <span class="nc">Of</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="p">,</span><span class="w"> </span><span class="n">b</span>: <span class="nc">Of</span><span class="o">&lt;'</span><span class="na">b</span><span class="p">,</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="p">)</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="kd">let</span><span class="w"> </span><span class="k">mut</span><span class="w"> </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">a</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="n">v</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">b</span><span class="p">;</span><span class="w"> </span><span class="c1">//~ [rustc E0623] [E] lifetime mismatch ...but data from `a` flows into `b` here</span>

<span class="w">    </span><span class="n">a</span><span class="w"> </span><span class="o">==</span><span class="w"> </span><span class="n">b</span><span class="p">;</span><span class="w"></span>
<span class="w">    </span><span class="c1">//^~ [rustc E0369] [E] binary operation `==` cannot be applied to type `&lt;&lt;T as UnPlugLife&gt;::T as PlugLife&gt;::T&lt;'a&gt;`</span>
<span class="w">    </span><span class="c1">//   the trait `std::cmp::PartialEq` is not implemented for `&lt;&lt;T as UnPlugLife&gt;::T as PlugLife&gt;::T&lt;'a&gt;`</span>
<span class="p">}</span><span class="w"></span>
</code></pre></div>



<a name="216446430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216446430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216446430">(Nov 12 2020 at 09:43)</a>:</h4>
<p>In particular I am confused by the "data from <code>a</code> flows into <code>b</code> here"  in the parametric case.<br>
Why does <code>'a: 'b, 'b: 'a</code> arise in <code>foo</code>, but not in <code>foo_str</code>?</p>



<a name="216446666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216446666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216446666">(Nov 12 2020 at 09:46)</a>:</h4>
<p>I expect the issue is that <code>&amp;str</code> is covariant, so <code>v</code> actually has the lt <code>'c</code> with <code>'a: 'c</code>, <code>'b: 'c</code></p>



<a name="216446726"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216446726" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216446726">(Nov 12 2020 at 09:47)</a>:</h4>
<p>The type param <code>T</code> is invariant so you don't have a shared subtype you can use for <code>v</code></p>



<a name="216448114"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216448114" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216448114">(Nov 12 2020 at 10:01)</a>:</h4>
<p>How does variance work with GAT?<br>
What's the variance of <code>T::L&lt;'a&gt;</code>?<br>
I'm assuming it's invariant since it produces the same errors.</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">trait</span><span class="w"> </span><span class="n">Life</span><span class="w"> </span><span class="p">{</span><span class="w"></span>
<span class="w">    </span><span class="k">type</span> <span class="nc">L</span><span class="o">&lt;'</span><span class="na">l</span><span class="o">&gt;</span>: <span class="o">'</span><span class="na">l</span> <span class="o">+</span><span class="w"> </span><span class="n">Life</span><span class="p">;</span><span class="w"></span>
<span class="p">}</span><span class="w"></span>

<span class="k">type</span> <span class="nc">Of</span><span class="o">&lt;'</span><span class="na">a</span><span class="p">,</span><span class="w"> </span><span class="cp">#[may_dangle]</span><span class="w"> </span><span class="n">T</span><span class="o">&gt;</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="o">&lt;</span><span class="n">T</span><span class="w"> </span><span class="k">as</span><span class="w"> </span><span class="n">Life</span><span class="o">&gt;</span>::<span class="n">L</span><span class="o">&lt;'</span><span class="na">a</span><span class="o">&gt;</span><span class="p">;</span><span class="w"></span>
</code></pre></div>



<a name="216448258"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216448258" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216448258">(Nov 12 2020 at 10:02)</a>:</h4>
<p>If type equality constraints ever land would <code>T == &lt;T as Life&gt;::L&lt;'a&gt;</code> fix my issue?</p>



<a name="216448959"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216448959" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216448959">(Nov 12 2020 at 10:10)</a>:</h4>
<p>probably</p>



<a name="216449156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216449156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216449156">(Nov 12 2020 at 10:12)</a>:</h4>
<p>can you share your full example on the playground?</p>



<a name="216449177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216449177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216449177">(Nov 12 2020 at 10:12)</a>:</h4>
<p>I want to experiment a bit here</p>



<a name="216450408"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216450408" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216450408">(Nov 12 2020 at 10:26)</a>:</h4>
<p><a href="https://github.com/Avi-D-coder/gc-gat">https://github.com/Avi-D-coder/gc-gat</a> (<a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=5521bd53c59b34e21a1d0f83ccc4899e">playground</a>)<br>
<a href="https://github.com/Avi-D-coder/gc-gat-plug/tree/plug">https://github.com/Avi-D-coder/gc-gat-plug/tree/plug</a> (<a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=5521bd53c59b34e21a1d0f83ccc4899e">playground</a>)<br>
<a href="https://github.com/Avi-D-coder/gc-gat-family">https://github.com/Avi-D-coder/gc-gat-family</a></p>
<p>These are the main playgrounds and most up to date branches, any of my repos prefixed <code>gc-*</code> have other version of the idea.</p>



<a name="216450628"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216450628" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216450628">(Nov 12 2020 at 10:28)</a>:</h4>
<p>I meant to share a version of that using <a href="https://play.rust-lang.org/">https://play.rust-lang.org/</a> <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span> don't have the energy to do this locally rn</p>



<a name="216450774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216450774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216450774">(Nov 12 2020 at 10:30)</a>:</h4>
<p>Added in parens</p>



<a name="216450958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216450958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216450958">(Nov 12 2020 at 10:32)</a>:</h4>
<p>The family pattern attempt is not in a sharable state out side of git. I think that ones a dead end anyway.</p>



<a name="216452142"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216452142" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216452142">(Nov 12 2020 at 10:44)</a>:</h4>
<p>I hoped that something like this might have worked <a href="https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7b6ba916162cfa9ccbab8a809822e2ff">https://play.rust-lang.org/?version=nightly&amp;mode=debug&amp;edition=2018&amp;gist=7b6ba916162cfa9ccbab8a809822e2ff</a></p>



<a name="216452514"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216452514" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216452514">(Nov 12 2020 at 10:49)</a>:</h4>
<p>also, I just reread your first comments and I really like the idea of injecting and erasing lt like this <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="216452766"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216452766" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216452766">(Nov 12 2020 at 10:51)</a>:</h4>
<p>I had hoped something like that would work as well.</p>
<p>Thanks for taking a look.<br>
Here's hoping I missed something!</p>



<a name="216453465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216453465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216453465">(Nov 12 2020 at 10:58)</a>:</h4>
<p>why do you want your types to be variant?</p>



<a name="216455645"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216455645" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216455645">(Nov 12 2020 at 11:23)</a>:</h4>
<p>New GCed allocations and marking into <code>Arena</code>s have to extend the lifetime of existing referenced objects.</p>



<a name="216592466"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216592466" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Avi Dessauer <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216592466">(Nov 13 2020 at 10:27)</a>:</h4>
<p><span class="user-mention" data-user-id="216206">@lcnr</span> How should I credit you in my blog post for pointing out the relation to variance?<br>
Should I use your username?</p>



<a name="216592494"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216592494" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216592494">(Nov 13 2020 at 10:27)</a>:</h4>
<p>that's a good question <span aria-label="laughter tears" class="emoji emoji-1f602" role="img" title="laughter tears">:laughter_tears:</span></p>



<a name="216592625"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Error%20in%20non%20concrete%20case%20only%3F/near/216592625" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> lcnr <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Error.20in.20non.20concrete.20case.20only.3F.html#216592625">(Nov 13 2020 at 10:29)</a>:</h4>
<p>I guess I would prefer <a href="https://github.com/lcnr">https://github.com/lcnr</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>